package com.lzy.cloud.push.controller;

import com.lzy.cloud.push.request.UMengParam;
import com.lzy.cloud.push.response.UMengResponse;
import com.lzy.cloud.push.umeng.util.UMengUtil;
import com.lzy.framework.core.output.Result;
import com.lzy.framework.core.utils.JsonUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 19516
 */
@RestController
@RequestMapping(value = "/push")
@Slf4j
public class PushController {

    @Autowired
    private UMengUtil uMengUtil;

    @RequestMapping(value = "/unicast")
    public Result unicast(@RequestBody UMengParam uMengParam) {
        return new Result(JsonUtils.JSONToObj(uMengUtil.unicast(uMengParam), UMengResponse.class));
    }
}
